package sctu.edu.java.year2016.team03.liyouhong.day20160607.chapter15_1;

/**
 * Created by Administrator on 2016/6/7 0007.
 * 1.尝试定义一个继承Thread类的类，并覆盖run()方法，在run()方法每隔100秒打印一句话。
 */
public class PrintWord extends Thread{
   public synchronized void WaitFor(){
       try {
           wait(100000);
           System.out.println("每个100秒打印一句话");
       } catch (InterruptedException e) {
           e.printStackTrace();

       }

   }

    public static void main(String[] args) {
        new PrintWord().WaitFor();
    }
}
